package cl.zeke.cursos.jsf2spring3jpa2.vista.managedbeans;

import javax.faces.context.FacesContext;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

/**
 *
 * @author eduardo
 */
@Component
@Scope("request")
public class MessagesBean {

    public boolean existenMensajesGlobales() {
        FacesContext fc = FacesContext.getCurrentInstance();
        if ((fc.getMessages(null) != null) && (fc.getMessages(null).hasNext())) {
            return true;
        }

        return false;
    }
}
